home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 4
/
QRZ Ham Radio Callsign Database - Volume 4.iso
/
files
/
dsp
/
fft
/
fteyaltr.z
/
fteyaltr
/
fftoutc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-10
|
2KB
|
120 lines
/* ------------------------- fftoutc.c -------------------------------- */
/* */
/* Author: Eyal Lebedinsky */
/* Date: May 1990 */
/* Version: 9 June 1991 */
/* */
/* called from fftg.c and generates C output */
/* uses the header "fftsubs.h" */
/* */
/* This program is released into the public domain. */
/* */
/*----------------------------------------------------------------------*/
#include <stdio.h>
static int stmts = 0, file = 0;
static char fname[256], ename[256];
void
start_fft (file_name, ep_name)
char *file_name, *ep_name;
{
if (file_name) {
strcpy (ename, ep_name);
strcpy (fname, file_name);
strcat (fname, "a.c");
file = 0;
}
freopen (fname, "wt", stdout);
printf ("#include \"fftsubs.h\"\n");
printf ("void %s(){\n", ename);
printf ("init\n");
stmts = 0;
}
void
end_fft (file_name, ep_name)
char *file_name, *ep_name;
{
printf ("}\n");
close (stdout);
}
void
break_fft (n)
int n;
{
stmts += n;
if (stmts > 1000) {
++fname[strlen (fname) - 3];
if (file++)
++ename[strlen (ename) - 1];
else
strcat (ename, "b");
printf ("%s();\n", ename);
printf ("}\n");
start_fft (NULL, NULL);
}
}
void
fft1 (i1)
int i1;
{
printf ("_fft1(%d)\n", i1);
break_fft (1);
}
void
fft2 (i1, i2)
int i1, i2;
{
printf ("_fft2(%d,%d)\n", i1, i2);
break_fft (7);
}
void
fft3 (i1, i3, i4)
int i1, i3, i4;
{
printf ("_fft3(%d,%d,%d)\n", i1, i3, i4);
break_fft (14);
}
void
fft4 (i1, i2, i3, i4, cc1)
int i1, i2, i3, i4, cc1;
{
printf ("_fft4(%d,%d,%d,%d,0x%04x)\n", i1, i2, i3, i4, cc1);
break_fft (17);
}
void
fft5 (i1, i2, i3, i4, i5, i6, i7, i8, sm1, sp1, cc1, sm3, sp3, cc3, ind)
int i1, i2, i3, i4, i5, i6, i7, i8, sm1, sp1, cc1, sm3, sp3, cc3, ind;
{
printf ("_fft5(%d,%d,%d,%d,%d,%d,%d,%d,",
i1, i2, i3, i4, i5, i6, i7, i8);
printf ("0x%04x,0x%04x,0x%04x,0x%04x,0x%04x,0x%04x,%d)\n",
sm1, sp1, cc1, sm3, sp3, cc3, ind);
break_fft (50);
}
void
fft7 (i1, i2)
int i1, i2;
{
printf ("_fft7(%d,%d)\n", i1, i2);
break_fft (4);
}
void
fft8 (i1, i2, i3)
int i1, i2, i3;
{
printf ("_fft8(%d,%d,%d)\n", i1, i2, i3);
break_fft (8);
}